/*
csyingwu
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace Kaidou.Model
{

	/// <summary>
	/// ITrnJuchuUketukeId interface for NHibernate mapped table 'trn_juchu_uketuke'.
	/// </summary>
	public interface ITrnJuchuUketukeId
	{
		#region Public Properties
		
		string JuchuNo
		{
			get ;
			set ;
		}
		
		string JuchuRecNo
		{
			get ;
			set ;
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
		#region Serialize
		/// <summary>
		/// Method for entity class serialization to XML file
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to write to. Will be overwritten if already exists.</param>
		void SerializeToFile( string pXMLFilePath );
		
		/// <summary>
		/// Method for entity class deserialization from XML file. Does not change this object content but returns another deserialized object instance
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to read from.</param>
		/// <returns>TrnJuchuUketukeId object restored from XML file</returns>
		TrnJuchuUketukeId DeserializeFromFile( string pXMLFilePath );
		
		#endregion
		
		
	}

	/// <summary>
	/// TrnJuchuUketukeId object for NHibernate mapped table 'trn_juchu_uketuke'.
	/// </summary>
	[Serializable]
	public class TrnJuchuUketukeId : ITrnJuchuUketukeId
	{
		#region Member Variables

		protected string _juchuNo;
		protected string _juchuRecNo;
		protected bool _isDeleted;
		protected bool _isChanged;
		#endregion
		
		#region Constructors
		public TrnJuchuUketukeId() {}
		
		public TrnJuchuUketukeId(string juchuNo, string juchuRecNo)
		{
			this._juchuNo = juchuNo; /*c*/ 
			this._juchuRecNo = juchuRecNo; /*c*/ 
		}
		
		#endregion
		
		
		
		#region Public Properties
		
		public string JuchuNo
		{
			get { return _juchuNo; }
			set { _isChanged |= (_juchuNo != value); _juchuNo = value; }
		}
		
		public string JuchuRecNo
		{
			get { return _juchuRecNo; }
			set { _isChanged |= (_juchuRecNo != value); _juchuRecNo = value; }
		}
		

		public bool IsDeleted
		{
			get { return _isDeleted; }
			set { _isDeleted = value; }
		}
		
		public bool IsChanged
		{
			get { return _isChanged; }
			set { _isChanged = value; }

		}
		
		#endregion 
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			TrnJuchuUketukeId castObj = null;
			try
			{
				castObj = (TrnJuchuUketukeId)obj;
			} catch(Exception) { return false; } 
			return (castObj != null) &&
				( this._juchuNo == castObj.JuchuNo ) &&
				( this._juchuRecNo == castObj.JuchuRecNo );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _juchuNo.GetHashCode(); /*c*/
			hash = 27 * hash * _juchuRecNo.GetHashCode(); /*c*/
			return hash; 
		}
		#endregion
		
		#region Serialize
		/// <summary>
		/// Method for entity class serialization to XML file
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to write to. Will be overwritten if already exists.</param>
		public virtual void SerializeToFile( string pXMLFilePath )
		{
			System.Xml.Serialization.XmlSerializer seriliaser = new System.Xml.Serialization.XmlSerializer( this.GetType() );
			using(System.IO.TextWriter txtWriter = new System.IO.StreamWriter( pXMLFilePath ))
			{
				seriliaser.Serialize(txtWriter, this);
				txtWriter.Close();
			}
		}
		/// <summary>
		/// Method for entity class deserialization from XML file. Does not change this object content but returns another deserialized object instance
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to read from.</param>
		/// <returns>TrnJuchuUketukeId object restored from XML file</returns>
		public virtual TrnJuchuUketukeId DeserializeFromFile( string pXMLFilePath )
		{
			TrnJuchuUketukeId _result = null;
			
			System.Xml.Serialization.XmlSerializer seriliaser = new System.Xml.Serialization.XmlSerializer( this.GetType() );
			using(System.IO.TextReader txtReader = new System.IO.StreamReader( pXMLFilePath ))
			{
				_result = (TrnJuchuUketukeId)seriliaser.Deserialize( txtReader );
				txtReader.Close();
			}
			return _result;
		}
		#endregion
		
		
	}
	
	#region Custom ICollection interface for TrnJuchuUketukeId 

	
	public interface ITrnJuchuUketukeIdCollection : ICollection
	{
		TrnJuchuUketukeId this[int index]{	get; set; }
		void Add(TrnJuchuUketukeId pTrnJuchuUketukeId);
		void Clear();
	}
	
	[Serializable]
	public class TrnJuchuUketukeIdCollection : ITrnJuchuUketukeIdCollection
	{
		private IList<TrnJuchuUketukeId> _arrayInternal;

		public TrnJuchuUketukeIdCollection()
		{
			_arrayInternal = new List<TrnJuchuUketukeId>();
		}
		
		public TrnJuchuUketukeIdCollection( IList<TrnJuchuUketukeId> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<TrnJuchuUketukeId>();
			}
		}

		public TrnJuchuUketukeId this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((TrnJuchuUketukeId[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(TrnJuchuUketukeId pTrnJuchuUketukeId) { _arrayInternal.Add(pTrnJuchuUketukeId); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<TrnJuchuUketukeId> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
